package list.ittest.Test.D_Dao;

import list.ittest.Test.E_Domain.Student;

import java.util.ArrayList;

public class StudentDao {
    static ArrayList<Student>list =new ArrayList<>();
    public void addStudent(Student stu) {
        list.add(stu);

    }

    public ArrayList<Student> findAllStudent() {
        return list;
    }

    public void deleteStudent(int i) {
        list.remove(i);
    }

    public void updateStudent(int i, Student s) {
        Student stu = list.get(i);
        stu.setName(s.getName());
        stu.setAge(s.getAge());
        stu.setBirthday(s.getBirthday());
    }
}
